import 'package:get/get_utils/src/extensions/internacionalization.dart';
import 'package:yt_devops/resources/str_res_keys.dart';

class AlarmHomeState {
  String hintText = ResKey.enterAlarmName.tr;
  int alarmSum = 0;
  int? alarmNum = 0;
  int? errorNum = 0;
  int? infoNum = 0;
  int? warnNum = 0;
}

class AlarmNumState {
  /// 紧急
  int? errorNum;

  /// 重要
  int? alarmNum;

  /// 次要
  int? warnNum;

  /// 提示
  int? infoNum;

  AlarmNumState({
    this.errorNum = 0,
    this.alarmNum = 0,
    this.warnNum = 0,
    this.infoNum = 0,
  });

  factory AlarmNumState.fromMap(Map<String, dynamic> json) => AlarmNumState(
        errorNum: json['errorNum'] ?? 0,
        alarmNum: json['alarmNum'] ?? 0,
        warnNum: json['warnNum'] ?? 0,
        infoNum: json['infoNum'] ?? 0,
      );

  Map<String, dynamic> toMap() => {
        "errorNum": errorNum,
        "alarmNum": alarmNum,
        "warnNum": warnNum,
        "infoNum": infoNum,
      };
}
